package com.bltec.emergency.service.recordService.impl;

import com.bltec.emergency.mapper.RecordDisasterMapper;
import com.bltec.emergency.model.RecordDisaster;
import com.bltec.emergency.service.recordService.RecordDisasterService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RecordDisasterServiceImpl implements RecordDisasterService {

    @Resource
    RecordDisasterMapper recordDisasterMapper;

    @Override
    public boolean add(RecordDisaster recordDisaster) {
        return recordDisasterMapper.insert(recordDisaster);
    }

    @Override
    public boolean deleteDisasterById(Long id) {
        return recordDisasterMapper.setDisableById(id);
    }

    @Override
    public boolean updateDisasterById(RecordDisaster recordDisaster) {
        return recordDisasterMapper.updateDisasterById(recordDisaster);
    }

    @Override
    public RecordDisaster getDisasterById(Long id) {
        return recordDisasterMapper.getDisasterById(id);
    }

    @Override
    public List<RecordDisaster> getAll() {
        return recordDisasterMapper.selectAll();
    }
}
